package com.xlp;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.xlp.TestJarService1;

import java.util.Arrays;

@SpringBootApplication
@ComponentScan({"com.xlp", "org.xlp"})
public class SpringDemoApplication {


	public static void main(String[] args) {
		//System.setProperty("debug", "true");
		System.setProperty("spring.main.allow-circular-references", "true");
		//ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext();
		//classPathXmlApplicationContext.refresh();
		//classPathXmlApplicationContext.getBean("testService");
        ConfigurableApplicationContext run = SpringApplication.run(SpringDemoApplication.class, args);
        String[] beanNamesForType = run.getBeanNamesForType(TestJarService1.class);
        System.out.println(Arrays.toString(beanNamesForType));
        System.out.println(run.getBean("testJarService"));
    }

}
